﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>邯郸市公安局峰峰矿区分局</title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/sub.css">
    <link rel="stylesheet" href="./css/page.css">
    <script src="./libs/jquery-1.9.1.min.js"></script>
    <script src="./libs/jquery.jDiaporama.js"></script>
    <script src="./libs/jquery.SuperSlide.2.1.1.js"></script>
    <script src="./libs/jquery.getParame.js"></script>
    <script src="./libs/jrender.min.js"></script>
    <script src="./js/config.js"></script>
    <!-- <script src="../config.js"></script> -->
    <!--[if IE 7]>
            <link rel="stylesheet" href="css/ie7.css">
    <![endif]-->
    <!--[if IE 8]>
            <link rel="stylesheet" href="css/ie8.css">
    <![endif]-->
</head>

<body>
     <!-- 背景 -->
    <div class="s-bg-box">
        <img class="bg-img-1" src="./images/bg/bg-1.jpg" alt="">
        <img class="bg-img-2" style="display:none" src="./images/bg/bg-2.jpg" alt="">
        <img class="bg-img-3" style="display:none" src="./images/bg/bg-3.jpg" alt="">
        <img class="bg-img-4" style="display:none" src="./images/bg/bg-4.jpg" alt="">
    </div>

    <script>
        $(function () {
            
            var i = 1;
            setInterval(function () {
                $('.s-bg-box').fadeOut('slow', function () {
                    $('.bg-img-'+i).hide();
                    i++;
                    if (i >= 5) {
                       i = 1;
                   }
                    $('.bg-img-'+i).show();

                    // $('.s-bg-box img').attr('src', './images/bg/bg-' + i + '.jpg');
                    $('.s-bg-box').fadeIn('slow');
                });
            }, 12000);
        });
    </script>

    <div class="s-content-box">

        <!-- 头部 -->
        <div class="s-header-box">
            <div class="s-logo-box"></div>
        </div>

        <!-- nav模板引擎 -->
        <script type="text/x-jsrender" id="nav-specCard">
            {{for return_body}} {{if #getIndex()
            <11}} <li class="" lmid="{{:content}}">
                <a href="{{:url}}" target="_blank">{{:title}}</a>
                </li>
                {{/if}} {{/for}}
        </script>

        <!-- nav -->
        <div class="s-nav-box">
            <ul class="left-box" id="nav-box">
                <li class="active">
                    <a href="">加载中...</a>
                </li>
            </ul>
            <div class="search-input-box">
                <input type="text" id="search-input" class="search-input" placeholder="站内搜索" />
                <div class="search-btn"></div>
            </div>
            <label for="search-input" class="search-lable">站内搜索</label>
            <script>
                $('.search-btn').on('click', function () {
                    var search_val = $('#search-input').val();
                    if (!search_val) {
                        return;
                    }
                    $('#search-input').val('');
                    window.open(encodeURI('/app/search.html?title=' + search_val));

                });
            </script>
        </div>


        <!-- 内容1部分 -->
        <div class="s-model-content-box">
            <div class="s-insert-content-box">
                <!-- 左边部分 -->
                <div class="s-left-box">
                    <div class="s-left-header-box">
                        新闻栏目
                    </div>

                    <!-- 新闻栏目模板引擎 -->
                    <script type="text/x-jsrender" id="lm-specCard">
                        {{for return_body}} <li class="s-left-bottom-list">
                            <a href="/app/sub.html?lmid={{:id}}" target="_blank" lmid="{{:id}}">
                                {{:lm}}
                            </a>
                            </li>{{/for}}
                    </script>

                    <script>
                        $(function () {
                            $.ajax({
                                type: 'post',
                                url: $.webConfig.apiUrl + 'lm/getlm',
                                dataType: 'json',
                                success: function (data) {
                                    console.log(data);
                                    if (data['return_code'] == 1) {
                                        // 栏目
                                        //获取模板
                                        var jsRenderTpl = $.templates('#lm-specCard');
                                        //末班与数据结合
                                        var finalTpl = jsRenderTpl(data);
                                        $('#lm-box').html(finalTpl);

                                        var lmid = $.getUrlParam('lmid');
                                        $(".s-left-bottom-list a[lmid=" + lmid + "]").css('color',
                                            'red');
                                    }
                                },
                                error: function (err) {
                                    console.log(err);
                                }
                            });

                        });
                    </script>


                    <div class="s-left-bottom-box">
                        <ul id="lm-box">
                            <li class="s-left-bottom-list">
                                <a href="">
                                    加载中...
                                </a>
                            </li>
                        </ul>
                    </div>

                    <div class="s-left-images-box">
                        <a href="/app/">
                            <img src="images/img-sub-1.jpg" alt="">
                        </a>
                        <a href="/app/">
                            <img src="images/img-sub-2.jpg" alt="">
                        </a>
                        <a href="/app/">
                            <img src="images/img-sub-3.jpg" alt="">
                        </a>
                    </div>
                </div>
                <div class="s-right-box">
                    <div class="s-insert-right-box">
                        <div class="s-right-top-box">
                            <span class="line"></span>
                            当前位置:
                            <a href="/app/">首页</a>
                            &gt;&gt;

                            <a id="second-link">栏目</a>
                        </div>
                        <script type="text/x-jsrender" id="page-specCard">
                            {{for return_body}}
                            <li>
                                <span class="dolt"></span>
                                <a class="left-title" href="/app/detail.html?articleid={{:id}}&lmid={{:lm}}" target="_blank">
                                    {{:title}}
                                    {{if qianShou==1}}
                        <span style="color:red;font-size:12px;">[签收]</span>
                        {{/if}}
                                </a>
                                <a class="right-time" href="/app/detail.html?articleid={{:id}}&lmid={{:lm}}" target="_blank">
                                    {{timeFilter:time}}
                                </a>
                            </li>
                            {{/for}}
                        </script>
                        <div class="s-right-bottom-box">
                            <ul id="page-box">
                                <li>
                                    <span class="dolt"></span>
                                    <a class="left-title" href="">
                                        加载中...
                                    </a>
                                    <a class="right-time" href="">
                                        加载中...
                                    </a>
                                </li>
                            </ul>

                        </div>
                    </div>


                    <div id="page" class="page_div"></div>
                </div>
                <div style="clear:both"></div>
            </div>

        </div>

    </div>

    <script>
        $(function () {
            $(
                '.s-model-content-box .s-insert-content-box .s-right-box .s-insert-right-box .s-right-bottom-box li:odd'
            ).css('background', '#d2effd');
        });
    </script>


    <!-- <script type="text/x-jsrender" id="youqing-specCard">
        {{for return_body}} {{if picClassify == 3}}

        <li class="g-foot-nav-li">
            <a href="{{:jumpPath}}" style="width:100%;height:100%;display:block;">
                <img width="100%" height="100%" src="{{:picUrl}}" alt="{{:title}}">
            </a>
        </li>
        {{/if}} {{/for}}
    </script> -->

    <!-- footer nav -->
    <!-- <div class="g-foot-nav-box">
        <ul class="g-foot-nav-ul" id="youqing-box">
            <li class="g-foot-nav-li">
                加载中...
            </li>
        </ul>
    </div> -->


    </div>

    <!-- 图片接口 -->
    <!-- <script>
        $(function () {
            // 获取轮播图
            $.ajax({
                type: 'post',
                url: $.webConfig.apiUrl + 'picture/getListPicture',
                dataType: 'json',
                success: function (data) {
                    // console.log(data);
                    if (data['return_code'] == 1) {

                        // 友情
                        var jsRenderTplYq = $.templates('#youqing-specCard');
                        //末班与数据结合
                        var finalTplYq = jsRenderTplYq(data);
                        $('#youqing-box').html(finalTplYq);

                    }
                },
                error: function (err) {
                    // console.log(err);
                }
            });
        })
    </script> -->


    </div>

    <!-- footer -->
    <div class="s-footer-box">
        <div class="s-footer-logo"></div>

        <!-- footer模板引擎 -->
        <script type="text/x-jsrender" id="footer-specCard">
            <p class="s-footer-content1">
                <span class="left">版权所有: {{:bqsy}}</span>
                <span class="right">地址：{{:dz}}</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">负责人：{{:fzr}}</span>
                <span class="right">维护人：{{:whr}}</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">电话：{{:dh}}</span>
                <span class="right">报警电话：{{:bjdh}}</span>
            </p>

            <p class="s-footer-content2">
                <a href="/app/IE8cn_XP.exe" style="text-decoration:none;color:#fff">【IE浏览器下载】</a>
                <a href="/app/login.html" style="text-decoration:none;color:#fff" target="_blank">| 后台链接</a>
            </p>

            <div class="s-footer-content3">
                <span class="text">
                    <!-- {{:bah}} -->
                </span>
            </div>

            <!-- footerlogo -->
            <!-- <div class="s-footer-icon">
                <div class="s-footer-icon-1"></div>
                <div class="s-footer-icon-2"></div>
            </div> -->
        </script>


        <div class="s-footer-content-box" id="footer-box">

            <p class="s-footer-content1">
                <span class="left">版权所有: 加载中...</span>
                <span class="right">地址：加载中...</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">负责人：加载中...</span>
                <span class="right">维护人：加载中...</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">电话：加载中...</span>
                <span class="right">报警电话：加载中...</span>
            </p>

            <p class="s-footer-content2">
                <a href="/app/IE8cn_XP.exe" style="text-decoration:none;color:#fff">【IE浏览器下载】</a>
                <a href="/app/login.html" style="text-decoration:none;color:#fff" target="_blank">| 后台链接</a>
            </p>

            <div class="s-footer-content3">
                <span class="text">
                     
                </span>
            </div>

            <!-- footerlogo -->
            <!-- <div class="s-footer-icon">
                <div class="s-footer-icon-1"></div>
                <div class="s-footer-icon-2"></div>
            </div> -->


        </div>




    </div>
</body>
<script src="./js/common.js"></script>
<script src="./libs/paging.js"></script>
<script>
    $(function () {
        // 定义时间过滤器 yyyy-MM-dd HH:mm:ss
        $.views.converters("timeFilter", function (val) {
            var fmt = "yyyy-MM-dd hh:mm:ss";
            var data = new Date(val);

            var o = {
                "M+": data.getMonth() + 1, //月份 
                "d+": data.getDate(), //日 
                "h+": data.getHours(), //小时 
                "m+": data.getMinutes(), //分 
                "s+": data.getSeconds(), //秒 
                "q+": Math.floor((data.getMonth() + 3) / 3), //季度 
                "S": data.getMilliseconds() //毫秒 
            };

            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (data.getFullYear() + "").substr(4 -
                RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length ==
                    1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));

            return fmt;
        });


        var lmid = $.getUrlParam('lmid');

        if (!lmid) {
            alert('参数错误');
            window.location.href = "/app/index.html";
        }


        ajaxPage(1);

        function ajaxPage(num) {
            $.ajax({
                url: $.webConfig.apiUrl + "news/getnewslms",
                type: "POST",
                data: {
                    lm: lmid,
                    rows: 18,
                    page: num
                },
                dataType: "json",
                success: function (data) {

                    //获取模板
                    var jsRenderPage = $.templates('#page-specCard');
                    //末班与数据结合
                    var finalPage = jsRenderPage(data);
                    $('#page-box').html(finalPage);

                    console.log(data);
                    console.log(Math.ceil(data.return_count / 18));
                    //分页
                    $("#page").paging({
                        pageNo: num,
                        totalPage: Math.ceil(data.return_count / 18),
                        totalSize: data.return_count,
                        callback: function (num) {
                            ajaxPage(num)
                        }
                    })
                }
            })
        }
    })
</script>

</html>